package space.hyf.service.impl;

import space.hyf.entity.User;
import space.hyf.service.UserService;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.security.core.userdetails.UserDetailsService;
import org.springframework.security.core.userdetails.UsernameNotFoundException;
import org.springframework.stereotype.Service;

/**
 * @Description: 用户服务实现类
 * @ClassName: UserServiceImpl
 * @Author: HCode
 * @Date: 2023/3/14 15:29
 * @Version: 1.0
 */
@Service
public class UserServiceImpl implements UserDetailsService, UserService {
    /**
     * 通过用户名与密码查找用户
     *
     * @param username 用户名
     * @param password 密码
     * @return 用户
     */
    @Override
    public User findUserByUsernameAndPassword(String username, String password) {
        return null;
    }

    /**
     * 通过用户ID查找用户
     *
     * @param id 用户ID
     * @return 用户
     */
    @Override
    public User findUserById(Long id) {
        return null;
    }

    /**
     * 注册用户
     *
     * @param user 用户信息
     * @return 注册用户信息
     */
    @Override
    public User addUser(User user) {
        return null;
    }

    /**
     * Security验证用户登录
     *
     * @param username 用户名
     * @return 用户信息
     * @throws UsernameNotFoundException 用户名不存在异常
     */
    @Override
    public UserDetails loadUserByUsername(String username) throws UsernameNotFoundException {
        return null;
    }
}
